if (strcmp(fmp->key, "PATH_SPEED_MPH") == 0) {
WAYPT_SET(wpt, speed, MPH_TO_MPS(atof(s)));
} else
+ if (strcmp(fmp->key, "PATH_SPEED_KNOTS") == 0) {
+ WAYPT_SET(wpt, speed, KNOTS_TO_MPS(atof(s)));
+ } else
if (strcmp(fmp->key, "PATH_COURSE") == 0) {
WAYPT_SET(wpt, course, atof(s));
} else
if (strcmp(fmp->key, "PATH_SPEED_MPH") == 0) {
writebuff( buff, fmp->printfc, MPS_TO_MPH(wpt->speed));
} else
+ if (strcmp(fmp->key, "PATH_SPEED_KNOTS") == 0) {
+ writebuff( buff, fmp->printfc, MPS_TO_KNOTS(wpt->speed));
+ } else
if (strcmp(fmp->key, "PATH_COURSE") == 0) {
writebuff( buff, fmp->printfc, wpt->course );
} else
/* meters/second to kilometers/hour */
#define MPS_TO_KPH(a) ((double)(a)*SECONDS_PER_HOUR/1000)
+
/* meters/second to miles/hour */
#define MPS_TO_MPH(a) (METERS_TO_MILES(a) * SECONDS_PER_HOUR)
+
+/* meters/second to knots */
+#define MPS_TO_KNOTS(a) (MPS_TO_KPH((a)/1.852))
+
/* kilometers/hour to meters/second */
#define KPH_TO_MPS(a) ((double)(a)*1000/SECONDS_PER_HOUR)
+
/* miles/hour to meters/second */
#define MPH_TO_MPS(a) (MILES_TO_METERS(a) / SECONDS_PER_HOUR)
+/* knots to meters/second */
+#define KNOTS_TO_MPS(a) (KPH_TO_MPS((a)*1.852))
+
/*
* Snprintf is in SUS (so it's in most UNIX-like substance) and it's in
* C99 (albeit with slightly different semantics) but it isn't in C89.
</screen>
</section>
+<section id="style_def_pathspeed_knots">
+<title>PATH_SPEED_KNOTS</title>
+<para>
+ Like PATH_SPEED but means knots (nautical).
+</para>
+<para>
+example:
+</para>
+<screen format="linespecific"> PATH_SPEED_KNOTS,"","%.1f"
+</screen>
+</section>
+
<section id="style_def_pathcourse">
<title>PATH_COURSE</title>
<para>